home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1130 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.4 KB  |  59 lines

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: IOSTREAM question : should ends manipulator flush buffer?
  5. Date: 17 Apr 1996 14:57:41 GMT
  6. Organization: GABI Software, Sarl.
  7. Sender: news@lts.sel.alcatel.de
  8. Approved: clamage@eng.sun.com (comp.std.c++)
  9. Message-ID: <KANZE.96Apr17120619@slsvgqt.lts.sel.alcatel.de>
  10. References: <sdm-1604961139410001@galois.ecs.soton.ac.uk>
  11. NNTP-Posting-Host: taumet.eng.sun.com
  12. In-Reply-To: S.D.Maclean@ecs.soton.ac.uk's message of 16 Apr 96 12:27:03 GMT
  13. Apparently-To: std-c++@ncar.ucar.edu
  14. Content-Length: 1390
  15. X-Lines: 34
  16. Originator: clamage@taumet
  17.  
  18. In article <sdm-1604961139410001@galois.ecs.soton.ac.uk>
  19. S.D.Maclean@ecs.soton.ac.uk (Stuart Maclean) writes:
  20.  
  21. |> Hi, I'm currently implementing a stream class where the external
  22. |> representation is a socket.  Whilst playing with the following
  23.  
  24. |> TCPSocket tcp;
  25. |> ....
  26. |> Sockstream  ss( tcp );
  27.  
  28. |> ss << "Hello World!" << endl;
  29. |> ss << "Hello World!" << ends;
  30.  
  31. |> I noticed that manipulator "endl" synchronises with the external
  32. |> representation, but "ends" does not.  Tracing our IOStream library,
  33. |> libg++-2.7.1, it indeed does not do a flush when using "ends".  In C++PL2
  34. |> by Stroustrup, page 348 has a comment implying that "ends" should do a
  35. |> flush.
  36.  
  37. |> Does anyone know the correct behaviour for "ends" in the Standard C++
  38. |> Library, whatever that is and whenever it may appear 8-)
  39.  
  40. The draft standard says nothing about a possible flush.
  41.  
  42. Given that ends means end of *string*, and the flush function is a
  43. no-op in ostringstream, it's possible that the standards committee
  44. simply felt that it wasn't necessary.  (It's also possible that this is
  45. an oversight in the draft.)
  46. -- 
  47. James Kanze         Tel.: (+33) 88 14 49 00        email: kanze@gabi-soft.fr
  48. GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
  49. Conseils, Θtudes et rΘalisations en logiciel orientΘ objet --
  50.                 -- A la recherche d'une activitΘ dans une region francophone
  51.  
  52.  
  53.  
  54. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  55. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  56. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  57. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  58. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  59.